﻿using AiQiuQuan.Sport.Model.Models;
using AiQiuQuan.Sport.WebApi.Services;
using DotNetCore.CAP;

namespace AiQiuQuan.Sport.WebApi.SubscribeServices.Impl
{
    /// <summary>
    /// 场馆账户订阅服务
    /// </summary>
    public class UserPointSubscribeService : ICapSubscribe, IUserPointSubscribeService
    {
        private readonly IBaseUserPointService _userPointService;

        /// <summary>
        /// ctor
        /// </summary>
        public UserPointSubscribeService(
            IBaseUserPointService userPointService)
        {
            _userPointService = userPointService;
        }

        /// <summary>
        /// 明细记录新增
        /// </summary>
        [CapSubscribe(MessageTopic.USER_POINT_RECORD_DETAIL, Group = MessageTopic.USER_POINT_RECORD_DETAIL)]
        public async Task AddRecordAsync(List<BaseUserPointRecordAddDto> modelList)
        {
            await _userPointService.AddRecordAsync(modelList);
        }
    }
}
